package com.example.exam;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class TimeDay {
    public String getTimeDay() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE");
        Date date = new Date();
        String time = simpleDateFormat.format(date);
        return time;
    }
    public String getMaxTimeDay(int day) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE,day);
        Date time1 = calendar.getTime();
        String time = simpleDateFormat.format(time1);
        return time;
    }
    public String getMinTimeDay(int day) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE,-day);
        Date time1 = calendar.getTime();
        String time = simpleDateFormat.format(time1);
        return time;
    }
}
